﻿<Window x:Class="AW.LLBLGen.DataContextDriver.Static.ConnectionDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:dataContextDriver="clr-namespace:AW.LLBLGen.DataContextDriver"
        xmlns:local="clr-namespace:AW.Winforms.Helpers.WPF;assembly=AW.Winforms.Helpers"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:properties="clr-namespace:AW.LLBLGen.DataContextDriver.Properties"
        xmlns:static="clr-namespace:AW.LLBLGen.DataContextDriver.Static"
        Title="{x:Static dataContextDriver:Constants.Name}"
        MinWidth="200"
        MinHeight="200"
        Background="{x:Static SystemColors.ControlBrush}"
        Closing="Window_Closing"
        Closed="ConnectionDialog_OnClosed"
        d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True,
                                         Type=static:ConnectionDialog}"
        d:DesignWidth="750"
        Loaded="Window_Loaded"
        SizeToContent="WidthAndHeight"
        WindowStartupLocation="CenterScreen"
        mc:Ignorable="d" Height="547">
  <Window.Resources>
    <static:LLBLConnectionTypeToVisibilityConverter x:Key="AdapterToVisibility" LLBLConnectionType="Adapter" />
    <static:LLBLConnectionTypeToVisibilityConverter x:Key="AdapterFactoryToVisibility"
                                                    LLBLConnectionType="AdapterFactory" />
    <static:LLBLConnectionTypeToVisibilityConverter x:Key="NotSelfServicingToVisibility"
                                                    Invert="True"
                                                    LLBLConnectionType="SelfServicing" />
    <CollectionViewSource x:Key="settingsViewSource"
                          d:DesignSource="{d:DesignInstance properties:Settings, CreateList=True}" />

    <local:NullToBoolConverter x:Key="cnvNullToBool" />
    <local:BoolToVisibilityConverter x:Key="cnvBoolToVisibilityConverter"
                                     FalseValue="Collapsed"
                                     Link="{StaticResource cnvNullToBool}"
                                     TrueValue="Visible" />
  </Window.Resources>
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <TabControl x:Name="TabControl" Margin="0">
      <TabItem Header="Connection" ToolTip="Connection settings required by LLBL">
        <StackPanel MinHeight="0" Margin="0,11,14,3">

          <DockPanel>
            <Label DockPanel.Dock="Right"
                   Padding="1"
                   ToolTip="{x:Static static:ConnectionDialog.TitleChooseLLBLEntityAssembly}">
              <Hyperlink Click="BrowseAssembly">
                <Run Text="Browse..." />
              </Hyperlink>
            </Label>
            <Label x:Name="lblAssemblyPath"
                   Content="Path to LLBL assembly containing a ILinqMetaData or IElementCreatorCore:"
                   Padding="0,0,0,1"
                   ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}" />
          </DockPanel>

          <TextBox x:Name="txtAssemblyPath"
                   Margin="0,0,0,6"
                   DataContext="{Binding}"
                   Text="{Binding CxInfo.CustomTypeInfo.CustomAssemblyPath}"
                   TextChanged="txtAssemblyPath_TextChanged"
                   ToolTip="{Binding Content, ElementName=lblAssemblyPath}" />

          <DockPanel x:Name="DockPanelTypeName" Visibility="{Binding CustomTypeNameVisibility}">
            <Label DockPanel.Dock="Right"
                   Padding="1"
                   ToolTip="{x:Static static:ConnectionDialog.TitleChooseCustomType}">
              <Hyperlink Click="ChooseType">
                <Run Text="Choose..." />
              </Hyperlink>
            </Label>
            <Label x:Name="lblLinqMetaDataType"
                   Padding="0,0,0,1"
                   ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}"
                   Content="Full name of LinqMetaData or ElementCreatorCore type:" />
          </DockPanel>

          <TextBox x:Name="txtTypeName"
                   Margin="0,0,0,6"
                   IsReadOnly="True"
                   Text="{Binding CxInfo.CustomTypeInfo.CustomTypeName}"
                   ToolTip="{Binding Content, ElementName=lblLinqMetaDataType}"
                   Visibility="{Binding CustomTypeNameVisibility}" />

          <DockPanel>
            <Label DockPanel.Dock="Right"
                   Padding="1"
                   ToolTip="{x:Static static:ConnectionDialog.TitleChooseApplicationConfigFile}">
              <Hyperlink Click="BrowseAppConfig">
                <Run Text="Browse..." />
              </Hyperlink>
            </Label>
            <Label x:Name="lblAppConfigPath"
                   Padding="0,0,0,1"
                   ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}"
                   Content="Application config file (if required):" />
          </DockPanel>

          <TextBox x:Name="txtAppConfigPath"
                   Text="{Binding CxInfo.AppConfigPath}"
                   ToolTip="{Binding Content, ElementName=lblAppConfigPath}" />

          <DockPanel>
            <Label x:Name="lblBoxDatabaseConnectionString"
                   Padding="0,0,0,1"
                   ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}"
                   Content="Database connection string (if required):" />
            <Label HorizontalAlignment="Right"
                   DockPanel.Dock="Right"
                   Padding="1">
              <Hyperlink x:Name="hlDataBaseConnectionDialog"
                         Click="DataBaseConnectionDialog"
                         ToolTip="Launch editor for framework provided database connection strings">
                <Run Text="Edit..." />
              </Hyperlink>
            </Label>
          </DockPanel>
          <TextBox x:Name="textBoxDatabaseConnectionString"
                   Margin="0,0,0,6"
                   Text="{Binding CxInfo.DatabaseInfo.CustomCxString}"
                   ToolTip="{Binding Content, ElementName=lblBoxDatabaseConnectionString}" />
          <DockPanel>
            <Label x:Name="lblBoxConnectionDisplayName"
                   Padding="0,0,0,1"
                   ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}"
                   Content="Connection Display Name (Optional):" />
          </DockPanel>
          <TextBox x:Name="textBoxConnectionDisplayName"
                   Margin="0,0,0,6"
                   Text="{Binding CxInfo.CustomTypeInfo.DisplayName}"
                   ToolTip="{Binding Content, ElementName=lblBoxConnectionDisplayName}" />
          <GroupBox Header="Adapter configuration"
                    ToolTip="{Binding Header, RelativeSource={RelativeSource Self}}"
                    Visibility="{Binding ConnectionTypeVisibility}">
            <StackPanel HorizontalAlignment="Left"
                        Orientation="Horizontal"
                        ToolTip="Adapter configuration kind">
              <StackPanel.Resources>
                <local:EnumToBooleanConverter x:Key="EnumToBooleanConverter" />
              </StackPanel.Resources>
              <RadioButton Margin="5,0,10,0"
                           Content="Adapter"
                           IsChecked="{Binding LLBLConnectionType, ConverterParameter={x:Static static:LLBLConnectionType.Adapter}, Converter={StaticResource EnumToBooleanConverter}}" />
              <RadioButton Margin="0,0,5,0"
                           Content="Adapter Factory"
                           IsChecked="{Binding LLBLConnectionType, ConverterParameter={x:Static static:LLBLConnectionType.AdapterFactory}, Converter={StaticResource EnumToBooleanConverter}}" />
            </StackPanel>
          </GroupBox>

          <StackPanel
            Visibility="{Binding CxInfo.DriverData.Element[ConnectionType].Value, Converter={StaticResource AdapterFactoryToVisibility}}">
            <DockPanel>
              <Label DockPanel.Dock="Right"
                     Padding="1"
                     ToolTip="{x:Static static:ConnectionDialog.TitleChooseDataAccessAdapterAssembly}">
                <Hyperlink Click="BrowseDataAccessAdapterAssembly"
                           ToolTip="{x:Static static:ConnectionDialog.TitleChooseFactoryAssembly}"
                           TargetName="{x:Static static:ConnectionDialog.ElementNameFactoryAssembly}">
                  <Run Text="Browse..." />
                </Hyperlink>
              </Label>
              <Label x:Name="lblFactoryAssembly"
                     Padding="0,0,0,1"
                     ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}"
                     Content="Path to Adapter Factory assembly:" />
            </DockPanel>
            <TextBox Margin="0,0,0,6"
                     Text="{Binding CxInfo.DriverData.Element[FactoryAssembly].Value}"
                     ToolTip="{Binding Content, ElementName=lblFactoryAssembly}" />

            <DockPanel>
              <Label DockPanel.Dock="Right" Padding="1">
                <Hyperlink Click="ChooseAdapterOrFactoryClass"
                           ToolTip="{Binding TargetName, RelativeSource={RelativeSource Self}}"
                           TargetName="FactoryType">
                  <Run Text="Choose..." />
                </Hyperlink>
              </Label>
              <Label x:Name="lblAdapterFactoryType"
                     Padding="0,0,0,1"
                     ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}"
                     Content="Full name of type containing Adapter Factory method:" />
            </DockPanel>
            <TextBox Text="{Binding CxInfo.DriverData.Element[FactoryType].Value}"
                     ToolTip="{Binding Content, ElementName=lblAdapterFactoryType}" />

            <DockPanel>
              <Label x:Name="lblChooseAdapterFactoryMethod"
                     DockPanel.Dock="Right"
                     Padding="1"
                     ToolTip="{x:Static static:ConnectionDialog.TitleChooseFactoryMethod}">
                <Hyperlink Click="ChooseAdapterFactoryMethod">
                  <Run Text="Choose..." />
                </Hyperlink>
              </Label>
              <Label x:Name="lblAdapterFactoryMethod"
                     Padding="0,0,0,1"
                     ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}"
                     Content="Adapter Factory method:" />
            </DockPanel>
            <TextBox Text="{Binding CxInfo.DriverData.Element[FactoryMethod].Value}"
                     ToolTip="{Binding Content, ElementName=lblAdapterFactoryMethod}" />
          </StackPanel>

          <StackPanel Visibility="{Binding LLBLConnectionType, Converter={StaticResource AdapterToVisibility}}">
            <DockPanel>
              <Label DockPanel.Dock="Right" Padding="1">
                <Hyperlink Click="BrowseDataAccessAdapterAssembly"
                           ToolTip="{x:Static static:ConnectionDialog.TitleChooseDataAccessAdapterAssembly}"
                           TargetName="{x:Static static:ConnectionDialog.ElementNameAdapterAssembly}">
                  <Run Text="Browse..." />
                </Hyperlink>
              </Label>
              <Label x:Name="lblAdapterAssembly"
                     Padding="0,0,0,1"
                     ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}"
                     Content="Path to Adapter assembly:" />
            </DockPanel>
            <TextBox x:Name="textBoxDataAccessAdapterAssemblyPath"
                     Text="{Binding CxInfo.DriverData.Element[AdapterAssembly].Value}"
                     ToolTip="{Binding Content, ElementName=lblAdapterAssembly}" />
            <DockPanel>
              <Label DockPanel.Dock="Right" Padding="1">
                <Hyperlink Click="ChooseAdapterOrFactoryClass"
                           ToolTip="{Binding TargetName, RelativeSource={RelativeSource Self}}"
                           TargetName="{x:Static static:ConnectionDialog.ElementNameAdapterType}">
                  <Run Text="Choose..." />
                </Hyperlink>
              </Label>
              <Label x:Name="lblAdapterType"
                     Padding="0,0,0,1"
                     ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}"
                     Content="Full name of Adapter type:" />
            </DockPanel>
            <TextBox x:Name="textBoxAdapterType"
                     Text="{Binding CxInfo.DriverData.Element[AdapterType].Value}"
                     ToolTip="{Binding Content, ElementName=lblAdapterType}" />
            <DockPanel>
              <Label DockPanel.Dock="Right" Padding="1">
                <Hyperlink Click="ChooseLlblFunctionMappingStoreMember"
                           ToolTip="{Binding TargetName, RelativeSource={RelativeSource Self}}">
                  <Run Text="Choose..." />
                </Hyperlink>
              </Label>
              <Label x:Name="lblFunctionMappingStoreMember"
                     Padding="0,0,0,1"
                     ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}"
                     Content="Name of FunctionMappingStoreMember:" />
            </DockPanel>
            <TextBox x:Name="textBoxFunctionMappingStoreMember"
                     Text="{Binding CxInfo.DriverData.Element[FunctionMappingStoreMember].Value}"
                     ToolTip="{Binding Content, ElementName=lblFunctionMappingStoreMember}" />
          </StackPanel>
        </StackPanel>
      </TabItem>
      <TabItem DataContext="{Binding CxInfo}"
               Header="SQL Database Settings"
               ToolTip="Database connection settings used to Execute SQL">
        <TabItem.Resources>
          <Style TargetType="{x:Type Label}">
            <Setter Property="ToolTip" Value="{Binding Content, RelativeSource={RelativeSource Self}}" />
          </Style>
        </TabItem.Resources>
        <Grid x:Name="grid12">
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="153" />
            <ColumnDefinition Width="20" />
            <ColumnDefinition Width="91" />
            <ColumnDefinition />
          </Grid.ColumnDefinitions>
          <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="29" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="29" />
            <RowDefinition Height="29" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
          </Grid.RowDefinitions>
          <Border Grid.Row="5"
                  Grid.RowSpan="16"
                  Grid.Column="0"
                  Grid.ColumnSpan="4"
                  Margin="0"
                  BorderBrush="LightBlue"
                  BorderThickness="2,2,2,2"
                  CornerRadius="10,10,10,10"
                  Padding="0,5" />
          <Label Grid.Row="6"
                 Grid.Column="0"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="Attach File:" />
          <CheckBox x:Name="attachFileCheckBox"
                    Grid.Row="6"
                    Grid.Column="1"
                    Height="16"
                    Margin="3"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center"
                    Content=""
                    IsChecked="{Binding DatabaseInfo.AttachFile, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          <Label Grid.Row="7"
                 Grid.Column="0"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="Attach File Name:" />
          <TextBox x:Name="attachFileNameTextBox"
                   Grid.Row="7"
                   Grid.Column="1"
                   Grid.ColumnSpan="3"
                   Height="23"
                   MinWidth="200"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Text="{Binding DatabaseInfo.AttachFileName, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          <Label Grid.Row="2"
                 Grid.Column="0"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center">
            <Hyperlink Click="DataBaseConnectionDialog"
                       ToolTip="{Binding ToolTip, ElementName=hlDataBaseConnectionDialog}">
              <Run Text="Connection String:" />
            </Hyperlink>
          </Label>
          <TextBox x:Name="customCxStringTextBox"
                   Grid.Row="2"
                   Grid.Column="1"
                   Grid.ColumnSpan="3"
                   Height="23"
                   MinWidth="200"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Text="{Binding DatabaseInfo.CustomCxString, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          <Label Grid.Row="4"
                 Grid.Column="0"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="Database:" />
          <TextBox x:Name="databaseTextBox"
                   Grid.Row="4"
                   Grid.Column="1"
                   Grid.ColumnSpan="3"
                   Height="23"
                   MinWidth="200"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Text="{Binding DatabaseInfo.Database, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          <Label Grid.Row="5"
                 Grid.Column="0"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="Db Version:" />
          <TextBox x:Name="dbVersionTextBox"
                   Grid.Row="5"
                   Grid.Column="1"
                   Grid.ColumnSpan="3"
                   Height="23"
                   MinWidth="200"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Text="{Binding DatabaseInfo.DbVersion, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          <Label Grid.Row="8"
                 Grid.Column="0"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="Encrypt Custom Cx String:" />
          <CheckBox x:Name="encryptCustomCxStringCheckBox"
                    Grid.Row="8"
                    Grid.Column="1"
                    Height="16"
                    Margin="3"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center"
                    Content=""
                    IsChecked="{Binding DatabaseInfo.EncryptCustomCxString, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          <Label Grid.Row="8"
                 Grid.Column="2"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="Encrypt Traffic:" />
          <CheckBox x:Name="encryptTrafficCheckBox"
                    Grid.Row="8"
                    Grid.Column="3"
                    Height="16"
                    Margin="3"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center"
                    Content=""
                    IsChecked="{Binding DatabaseInfo.EncryptTraffic, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          <Label Grid.Row="13"
                 Grid.Column="0"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="Max Database Size:" />
          <TextBox x:Name="maxDatabaseSizeTextBox"
                   Grid.Row="13"
                   Grid.Column="1"
                   Grid.ColumnSpan="3"
                   Height="23"
                   MinWidth="200"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Text="{Binding DatabaseInfo.MaxDatabaseSize, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          <Label Grid.Row="18"
                 Grid.Column="0"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="Password:" />
          <TextBox x:Name="passwordTextBox"
                   Grid.Row="18"
                   Grid.Column="1"
                   Grid.ColumnSpan="3"
                   Height="23"
                   MinWidth="200"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Text="{Binding DatabaseInfo.Password, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          <Label Grid.Column="0"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="Provider:" />
          <ComboBox x:Name="providerComboBox"
                    Grid.Column="1"
                    Grid.ColumnSpan="3"
                    MinWidth="150"
                    MinHeight="23"
                    Margin="3"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center"
                    d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type static:ConnectionDialog}}"
                    ItemsSource="{Binding DbProviderFactoryNames, RelativeSource={RelativeSource AncestorType={x:Type Window}, Mode=FindAncestor}}"
                    SelectedItem="{Binding Provider, RelativeSource={RelativeSource AncestorType={x:Type Window}, Mode=FindAncestor}}" />
          <StackPanel Grid.Row="1"
                      Grid.Column="0"
                      Grid.ColumnSpan="4"
                      Margin="3,0,0,0"
                      Orientation="Horizontal">
            <Button x:Name="SetConnectionString"
                    Margin="5,0,0,5"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center"
                    Click="SetConnectionString_Click"
                    Content="Set connection string"
                    IsEnabled="{Binding DatabaseInfo.Server, Converter={StaticResource cnvNullToBool}}"
                    Padding="5,1"
                    ToolTip="Create connection string from database settings" />
            <Button x:Name="GetConnectionString"
                    Grid.Row="1"
                    Grid.Column="1"
                    Margin="5,0,0,5"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center"
                    Click="GetConnectionString_Click"
                    Content="Fill from connection string"
                    IsEnabled="{Binding DatabaseInfo.CustomCxString, Converter={StaticResource cnvNullToBool}}"
                    Padding="5,1"
                    ToolTip="Set database settings from connection string" />
          </StackPanel>

          <Label Grid.Row="3"
                 Grid.Column="0"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="Server:" />
          <TextBox x:Name="serverTextBox"
                   Grid.Row="3"
                   Grid.Column="1"
                   Grid.ColumnSpan="3"
                   Height="23"
                   MinWidth="200"
                   Margin="3,5,0,0"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   Text="{Binding DatabaseInfo.Server, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          <Label Grid.Row="15"
                 Grid.Column="0"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="Sql Security:" />
          <CheckBox x:Name="sqlSecurityCheckBox"
                    Grid.Row="15"
                    Grid.Column="1"
                    Height="16"
                    Margin="3"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center"
                    Content=""
                    IsChecked="{Binding DatabaseInfo.SqlSecurity, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          <Label Grid.Row="15"
                 Grid.Column="2"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="User Instance:" />
          <CheckBox x:Name="userInstanceCheckBox"
                    Grid.Row="15"
                    Grid.Column="3"
                    Height="16"
                    Margin="3"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center"
                    Content=""
                    IsChecked="{Binding DatabaseInfo.UserInstance, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          <Label Grid.Row="17"
                 Grid.Column="0"
                 Margin="3"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
                 Content="User Name:" />
          <TextBox x:Name="userNameTextBox"
                   Grid.Row="17"
                   Grid.Column="1"
                   Grid.ColumnSpan="3"
                   Height="23"
                   MinWidth="200"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Text="{Binding DatabaseInfo.UserName, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
        </Grid>
      </TabItem>
      <TabItem Header="User Interface"
               ToolTip="Options for the Schema Tree View and Grid output">
        <Grid>
          <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
          </Grid.RowDefinitions>
          <StackPanel Orientation="Vertical">
            <StackPanel Orientation="Horizontal">
              <Label x:Name="lblSchemaTreeView"
                   ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}" FontWeight="Bold">
                Schema Tree View:
              </Label>
              <CheckBox
              IsChecked="{Binding CxInfo.DriverData.Element[UseFields].Value}"
              ToolTip="If you choose to use entity information to create the schema tree more information will be shown in the tree nodes tooltips however only properties created by the designer are shown"
              Content="Use entity info rather then just reflection"  VerticalAlignment="Center" />
              <CheckBox
              IsChecked="{Binding CxInfo.DriverData.Element[UseSchema].Value}"
              ToolTip="Use Table Schema to group the Entities"
              Content="Use Table Schema to group the Entities"  VerticalAlignment="Center" Margin="5,0,0,0" />
            </StackPanel>
            <Label x:Name="lblPrefixDelimiterToGroupBy"
                 ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}">
              Table Prefix Delimiter to group Entities by (e.g. with a delimiter of __ table Sales__Order would grouped into a node called Sales)
            </Label>
            <TextBox x:Name="TextBoxTablePrefixDelimiterToGroupBy" Text="{Binding CxInfo.DriverData.Element[TablePrefixDelimiterToGroupBy].Value}"
                   ToolTip="{Binding Content, ElementName=lblPrefixDelimiterToGroupBy}" />
            <Label x:Name="lblPrefixesToGroupBy"
                 ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}">
              Table Prefixes to group Entities by (one per line) (e.g. A prefix of Customer would group tables Customer,CustomerDemographic and CustomerCustomerDemo together)
            </Label>
            <TextBox x:Name="TextBoxTablePrefixesToGroupBy" Text="{Binding CxInfo.DriverData.Element[TablePrefixesToGroupBy].Value}"

                   HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" AutoWordSelection="True"
                   AcceptsReturn="True"
                   ToolTip="{Binding Content, ElementName=lblPrefixesToGroupBy}" />
          </StackPanel>
          <Label Grid.Row="1" FontWeight="Bold">Data Grids:</Label>
          <StackPanel Grid.Row="2" Orientation="Horizontal">
            <Label x:Name="lblComboBoxDisplayInGrid"
                   ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}">
              Options to use when a query is run with 'Results to Data Grids':
            </Label>
            <ComboBox x:Name="ComboBoxDisplayInGrid"
                      DisplayMemberPath="Description"
                      ItemsSource="{Binding Source={local:Enumeration {x:Type dataContextDriver:DisplayInGrid}}}"
                      SelectedValue="{Binding CxInfo.DriverData.Element[DisplayInGrid].Value, Mode=TwoWay}"
                      SelectedValuePath="Value"
                      ToolTip="{Binding Content, ElementName=lblComboBoxDisplayInGrid}"
                      Width="450" />
          </StackPanel>
          <Label x:Name="lblMembersToExclude" Grid.Row="3"
                 ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}">
            Properties to Exclude from display in the grid (one per line)
          </Label>
          <TextBox x:Name="TextBoxMembersToExclude" Text="{Binding CxInfo.DriverData.Element[MembersToExclude].Value}"
                   Grid.Row="4"
                   HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" AutoWordSelection="True"
                   AcceptsReturn="True"
                   ToolTip="{Binding Content, ElementName=lblMembersToExclude}" />
        </Grid>
      </TabItem>
      <TabItem x:Name="AdditionalAssembliesAndNamespaces" Header="Additional Assemblies and Namespaces"
               d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type static:ConnectionDialog}}"
               DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type Window}}}">
        <Grid>
          <Grid.RowDefinitions>
            <RowDefinition Height="Auto" Name="RowDefAdditionalAssemblies" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
          </Grid.RowDefinitions>
          <DataGrid x:Name="AdditionalAssembliesDataGridCnxt"
                    MinWidth="200"
                    AutoGenerateColumns="False"
                    ItemsSource="{Binding AdditionalAssembliesCnxt, NotifyOnValidationError=true, ValidatesOnExceptions=true}"
                    ToolTip="{x:Static static:ConnectionDialog.AdditionalAssembliesToolTipCnxt}" Margin="0">
            <DataGrid.Columns>
              <DataGridTextColumn Binding="{Binding Value, UpdateSourceTrigger=PropertyChanged}">
                <DataGridTextColumn.Header>
                  <Hyperlink Click="ChooseAssembliesCnxt">
                    <Run Text="Additional Assemblies" />
                  </Hyperlink>
                </DataGridTextColumn.Header>
              </DataGridTextColumn>
            </DataGrid.Columns>
          </DataGrid>

          <Grid Grid.Row="2" x:Name="NamespacesCanvas" Height="Auto">
            <DataGrid x:Name="AdditionalNamespacesDataGridCnxt"
                      MinWidth="200"
                      MaxHeight="{Binding ElementName=NamespacesCanvas, Path=ActualHeight}"
                      AutoGenerateColumns="False"
                      ItemsSource="{Binding AdditionalNamespacesCnxt, NotifyOnValidationError=true, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=true}"
                      ToolTip="{x:Static static:ConnectionDialog.AdditionalNamespacesToolTipCnxt}" Margin="0">
              <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Value}" Header="Additional Namespaces" />
              </DataGrid.Columns>
            </DataGrid>
          </Grid>
          <WrapPanel Orientation="Horizontal" Margin="0" Grid.Row="3">

            <Button x:Name="buttonClearAdditionalCnxt"
                    Margin="5,0,0,0"
                    VerticalAlignment="Center"
                    Click="buttonClearAdditionalCnxtClick"
                    Content="Clear additional"
                    ToolTip="Clear additional Assemblies and Namespaces" />
            <Button Margin="5,0,0,0"
                    VerticalAlignment="Center"
                    Click="ChooseAssembliesCnxt"
                    Content="Add Assemblies..."
                    ToolTip="Browse for Additional Assemblies" />
            <Button x:Name="AddORMProfilerCnxtButton" Margin="5,0,0,0"
                    VerticalAlignment="Center"
                    Click="AddORMProfilerCnxt"
                    Content="Add ORM Profiler"
                    ToolTip="Add ORM Profiler assemblies" />
            <Button Margin="5,0,0,0"
                    VerticalAlignment="Center"
                    Click="AddHumanizerCnxt"
                    Content="Add Humanizer"
                    ToolTip="Add Humanizer assemblies and Namespace" />
            <Button Margin="5,0,0,0"
                    VerticalAlignment="Center"
                    Click="AddNamespacesFromAssemblies"
                    Content="Add namespaces from selected assemblies"
                    ToolTip="Add namespaces from selected assemblies and the assemblies defined in the driver" />
          </WrapPanel>
          <GridSplitter Name="gridSplitterAdditionalAssemblies" HorizontalAlignment="Stretch" Height="2"
                        VerticalAlignment="Top" Grid.Row="1"
                        Background="Black" ResizeBehavior="PreviousAndNext"
                        ShowsPreview="True" DragStarted="GridSplitter_DragStarted"
                        DragCompleted="GridSplitter_DragCompleted" />
        </Grid>
      </TabItem>
      <TabItem x:Name="DriverTab"
               Header="Driver"
               ToolTip="Settings global to all connections">
        <TabItem.Resources>
          <Style TargetType="{x:Type TextBox}">
            <Setter Property="MinWidth" Value="50" />
          </Style>
          <Style TargetType="{x:Type Label}">
            <Setter Property="ToolTip" Value="{Binding Content, RelativeSource={RelativeSource Self}}" />
          </Style>
        </TabItem.Resources>
        <TabItem.DataContext>
          <StaticResource ResourceKey="settingsViewSource" />
        </TabItem.DataContext>
        <Grid Margin="0">
          <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
          </Grid.RowDefinitions>
          <Grid x:Name="grid13"
                HorizontalAlignment="Left"
                VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0"
                   Grid.Column="0"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Content="Default Provider:" />
            <TextBox x:Name="defaultProviderTextBox"
                     Grid.Row="0"
                     Grid.Column="1"
                     Width="120"
                     Height="23"
                     Margin="3"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     Text="{Binding DefaultProvider, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          </Grid>
          <Grid x:Name="grid8"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Margin="0,32,0,0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="116" />
              <ColumnDefinition Width="28" />
              <ColumnDefinition Width="29" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.ColumnSpan="3"
                   Margin="3,3,0,3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Content="Default Database Connection:" />
            <TextBox x:Name="defaultDatabaseConnectionTextBox"
                     Grid.Column="3"
                     Height="23"
                     Margin="3"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     Text="{Binding DefaultDatabaseConnection, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          </Grid>
          <Grid x:Name="grid3"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Margin="0,64,0,0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0"
                   Grid.Column="0"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Content="Default Application Config:" />
            <TextBox x:Name="defaultApplicationConfigTextBox"
                     Grid.Row="0"
                     Grid.Column="1"
                     Height="23"
                     Margin="3"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     Text="{Binding DefaultApplicationConfig, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          </Grid>
          <Grid x:Name="grid4"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Margin="0,96,0,0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0"
                   Grid.Column="0"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Content="Default Connection Type:" />
            <TextBox x:Name="defaultConnectionTypeTextBox"
                     Grid.Row="0"
                     Grid.Column="1"
                     Height="23"
                     Margin="3"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     Text="{Binding DefaultConnectionType, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          </Grid>
          <Grid x:Name="grid9"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Margin="0,128,0,0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0"
                   Grid.Column="0"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Content="Default Display Name:" />
            <TextBox x:Name="defaultDisplayNameTextBox"
                     Grid.Row="0"
                     Grid.Column="1"
                     Height="23"
                     Margin="3"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     Text="{Binding DefaultDisplayName, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          </Grid>
          <Grid x:Name="grid10"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Margin="0,160,0,0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0"
                   Grid.Column="0"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Content="Default Linq Meta Data:" />
            <TextBox x:Name="defaultLinqMetaDataTextBox"
                     Grid.Row="0"
                     Grid.Column="1"
                     Height="23"
                     Margin="3"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     Text="{Binding DefaultLinqMetaData, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          </Grid>
          <Grid x:Name="grid11"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Margin="0,192,0,0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0"
                   Grid.Column="0"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Content="Default Linq Meta Data Assembly:" />
            <TextBox x:Name="defaultLinqMetaDataAssemblyTextBox"
                     Grid.Row="0"
                     Grid.Column="1"
                     Height="23"
                     Margin="3"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     Text="{Binding DefaultLinqMetaDataAssembly, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          </Grid>
          <Grid x:Name="grid1"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Margin="0,224,0,0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0"
                   Grid.Column="0"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Content="Default Adapter Assembly:" />
            <TextBox x:Name="defaultAdapterAssemblyTextBox"
                     Grid.Row="0"
                     Grid.Column="1"
                     Height="23"
                     Margin="3"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     Text="{Binding DefaultAdapterAssembly, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          </Grid>
          <Grid x:Name="grid2"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Margin="0,256,0,0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0"
                   Grid.Column="0"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Content="Default Adapter Type:" />
            <TextBox x:Name="defaultAdapterTypeTextBox"
                     Grid.Row="0"
                     Grid.Column="1"
                     Height="23"
                     Margin="3"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     Text="{Binding DefaultAdapterType, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          </Grid>

          <Grid x:Name="grid5"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Margin="0,288,0,0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0"
                   Grid.Column="0"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Content="Default Data Access Adapter Factory Assembly:" />
            <TextBox x:Name="defaultDataAccessAdapterFactoryAssemblyTextBox"
                     Grid.Row="0"
                     Grid.Column="1"
                     Height="23"
                     Margin="3"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     Text="{Binding DefaultDataAccessAdapterFactoryAssembly, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          </Grid>
          <Grid x:Name="grid6"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Margin="0,320,0,0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0"
                   Grid.Column="0"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Content="Default Data Access Adapter Factory Method:" />
            <TextBox x:Name="defaultDataAccessAdapterFactoryMethodTextBox"
                     Grid.Row="0"
                     Grid.Column="1"
                     Height="23"
                     Margin="3"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     Text="{Binding DefaultDataAccessAdapterFactoryMethod, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          </Grid>
          <Grid x:Name="grid7"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Margin="0,352,0,0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0"
                   Grid.Column="0"
                   Margin="3"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Center"
                   Content="Default Data Access Adapter Factory Type:" />
            <TextBox x:Name="defaultDataAccessAdapterFactoryTypeTextBox"
                     Grid.Row="0"
                     Grid.Column="1"
                     Height="23"
                     Margin="3"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
                     Text="{Binding DefaultDataAccessAdapterFactoryType, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
          </Grid>

          <WrapPanel
            Grid.Row="1"
            d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type static:ConnectionDialog}}"
            DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type Window}}}"
            Orientation="Horizontal" Margin="0,0,0,0">
            <DataGrid x:Name="AdditionalAssembliesDataGrid"
                      MinWidth="100"
                      AutoGenerateColumns="False"
                      ItemsSource="{Binding AdditionalAssemblies, NotifyOnValidationError=true, ValidatesOnExceptions=true}"
                      ToolTip="{x:Static static:ConnectionDialog.AdditionalAssembliesToolTip}">
              <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Value, UpdateSourceTrigger=PropertyChanged}">
                  <DataGridTextColumn.Header>
                    <Hyperlink Click="ChooseAssemblies">
                      <Run Text="Additional Assemblies" />
                    </Hyperlink>
                  </DataGridTextColumn.Header>
                </DataGridTextColumn>
              </DataGrid.Columns>
            </DataGrid>
            <DataGrid x:Name="AdditionalNamespacesDataGrid"
                      MinWidth="100"
                      AutoGenerateColumns="False"
                      ItemsSource="{Binding AdditionalNamespaces, NotifyOnValidationError=true, ValidatesOnExceptions=true}"
                      ToolTip="{x:Static static:ConnectionDialog.AdditionalNamespacesToolTip}">
              <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Value}" Header="Additional Namespaces" />
              </DataGrid.Columns>
            </DataGrid>

            <Button x:Name="buttonClearAdditional"
                    Margin="5,0,0,0"
                    VerticalAlignment="Center"
                    Click="buttonClearAdditionalClick"
                    Content="Clear additional"
                    ToolTip="Clear additional Assemblies and Namespaces" />
            <Button Margin="5,0,0,0"
                    VerticalAlignment="Center"
                    Click="ChooseAssemblies"
                    Content="Add Assemblies..."
                    ToolTip="Browse for Additional Assemblies" />
            <Button x:Name="AddORMProfilerButton" Margin="5,0,0,0"
                    VerticalAlignment="Center"
                    Click="AddORMProfiler"
                    Content="Add ORM Profiler"
                    ToolTip="Add ORM Profiler assemblies" />
            <Button x:Name="buttonClearDefaults"
                    Margin="5,0,0,0"
                    VerticalAlignment="Center"
                    Click="buttonClear_Click"
                    Content="Clear defaults"
                    ToolTip="Clear defaults" />
            <Button Margin="5,0,0,0"
                    VerticalAlignment="Center"
                    Content="Copy to plugins"
                    ToolTip="Copy support assemblies to LINQPad plugins folder" Click="ButtonCopyToPlugins_Click" />
            <TextBlock Margin="5,0,0,0">
    <Hyperlink ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Self}}" NavigateUri="https://rapiddevbookcode.codeplex.com/wikipage?title=LLBL4linqpad" Click="Url_Click">Driver Home page</Hyperlink>
            </TextBlock>
            <TextBlock Margin="5,0,0,0">
       <Hyperlink x:Name="DriverDirectory" NavigateUri="" ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Self}}" Click="Url_Click">Driver Directory</Hyperlink>
            </TextBlock>
            <TextBlock Margin="5,0,0,0">
                <Hyperlink  x:Name="LINQPadErrorLog" NavigateUri="" ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Self}}" Click="Url_Click">LINQPad Error Log</Hyperlink>
            </TextBlock>
            <TextBlock Margin="5,0,0,0">
                <Hyperlink  x:Name="LINQPadConnections" NavigateUri="" ToolTip="{Binding NavigateUri, RelativeSource={RelativeSource Self}}" Click="Url_Click">LINQPad Connections File</Hyperlink>
            </TextBlock>
            <Button Margin="5,0,0,0"
                    VerticalAlignment="Center"
                    Content="About"
                    ToolTip="Details about this driver's assemblies" Click="Button_Click" />
          </WrapPanel>
        </Grid>
      </TabItem>
    </TabControl>
    <DockPanel Margin="0,5,0,0" LastChildFill="False" Grid.Row="1" MinHeight="30" RenderTransformOrigin="0.519,-10.367"
               MaxHeight="30">
      <StackPanel Orientation="Horizontal">
        <StackPanel.Resources>
          <Style TargetType="{x:Type ComboBox}">
            <Setter Property="Margin" Value="5,0,5,0" />
          </Style>
        </StackPanel.Resources>
        <CheckBox Margin="1,0,0,5"
                  IsChecked="{Binding CxInfo.Persist}"
                  ToolTip="{Binding Content, RelativeSource={RelativeSource Self}}"
                  Content="Remember this connection"
                  VerticalAlignment="Center" />
        <Button x:Name="btnSaveDefault"
                MinWidth="60"
                Margin="5,0,0,0"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                VerticalContentAlignment="Center"
                Click="btnSaveDefault_Click"
                Content="Save as default"
                Padding="8,2"
                TabIndex="1"
                ToolTip="Save this connection as the default for new connections, this enables cloning of a connection" />
        <Button x:Name="btnImportExisting"
                Margin="5,0,0,0"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                VerticalContentAlignment="Center"
                Content="Import Existing Connection"
                Padding="8,2"
                TabIndex="1"
                ToolTip="Base this connection on an existing connection" Click="btnImportExisting_Click" />
      </StackPanel>
      <Button x:Name="btnCancel"
              MinWidth="60"
              Margin="5,0,5,5"
              Click="btnCancel_Click"
              Content="Cancel"
              DockPanel.Dock="Right"
              IsCancel="True"
              Padding="8,2"
              TabIndex="2" />
      <Button x:Name="btnOK"
              MinWidth="60"
              Margin="5,0,5,5"
              Click="btnOK_Click"
              Content="OK"
              DockPanel.Dock="Right"
              Padding="8,2"
              TabIndex="1" IsDefault="True" />
    </DockPanel>
  </Grid>
</Window>